package com.inetools.gwetons.client.logging;


import com.google.gwt.inject.client.AbstractGinModule;
import com.google.inject.Provider;
import com.inetools.gwetons.shared.logging.LogUtil;
import com.inetools.gwetons.shared.logging.LogUtilImpl;

/**
 * Made the below classes in order to have one central point to control/manage/customize Logger 
 * behavior since the behavior of Logger has been really not reliable on GWT. <br />
 * <ul> 
 * <li>LogUtil interface</li>
 * <li>LogUtilGinJector interface</li>
 * <li>LogUtilGinModule class</li>
 * <li>LogUtilFactoryIntf interface</li>
 * <li>LogUtilFactory enum</li>
 * </ul> 
 * Adapter to implement desired work around. It can be possible by modifying this class to redirect 
 * log output to Log4J when shared code is used at server side, change to certain level, process 
 * logging message, etc.
 * @author ay
 */
public class LogUtilGinModule extends AbstractGinModule {
	@Override
	protected void configure() {
		bind( LogUtil.class).toProvider( LogUtilProvider.class);
	}

	static class LogUtilProvider implements Provider<LogUtil> {
		@Override
		public LogUtil get() {
			return new LogUtilImpl();
		}
	}

}
